<template>
  <div class="home app-space">
    <!-- header -->
    <Search></Search>
    <div class="index-wrap">
      <van-tabs v-model="tabactive" class="sign-tabs" swipe-threshold="5">
        <!-- 科一 -->
        <van-tab>
          <template #title>
            <span class="tab-span">科一</span>
          </template>
          <div class="cf_overflow">
            <div class="index-grid">
              <div class="index-banner">
                <van-swipe :autoplay="3000" height="140" class="banner-swiper">
                  <van-swipe-item v-for="(image, index) in images" :key="index">
                    <img :src="image.picaddress" />
                  </van-swipe-item>
                </van-swipe>
              </div>
              <van-row :gutter="20" class="enter-rows">
                <van-col :span="12">
                  <router-link to="/SequentialExam/1" class="enter-link lk-1">
                    <img src="../assets/link1.png" />
                    <div class="weui-cell__bd">
                      <div class="txt">顺序练习</div>
                      <!-- <div class="val">0/1325题</div> -->
                    </div>
                  </router-link>
                </van-col>
                <van-col :span="12">
                  <router-link to="/MockExam/1" class="enter-link lk-2">
                    <img src="../assets/link1.png" />
                    <div class="weui-cell__bd">
                      <div class="txt">模拟考试</div>
                      <!-- <div class="val">未考试/0分</div> -->
                    </div>
                  </router-link>
                </van-col>
              </van-row>
              <van-row :gutter="10" class="index-menus">
                <van-col :span="6">
                  <div @click="href()" class="index-menu-box">
                    <img src="../assets/index1.png" />
                    <p>VIP课程</p>
                  </div>
                </van-col>
                <van-col :span="6">
                  <router-link to="/IconTechnical" class="index-menu-box">
                    <img src="../assets/index2.png" />
                    <p>图标技巧</p>
                  </router-link>
                </van-col>
                <van-col :span="6">
                  <div @click="href()" class="index-menu-box">
                    <img src="../assets/index3.png" />
                    <p>专项练习</p>
                  </div>
                </van-col>
                <van-col :span="6">
                  <router-link to="/MistakesCollect" class="index-menu-box">
                    <img src="../assets/index4.png" />
                    <p>错题收藏</p>
                  </router-link>
                </van-col>
                <van-col :span="6">
                  <router-link to="/Esoterica/1" class="index-menu-box">
                    <img src="../assets/index5.png" />
                    <p>考试秘笈</p>
                  </router-link>
                </van-col>
                <van-col :span="6">
                  <div @click="href()" class="index-menu-box">
                    <img src="../assets/index6.png" />
                    <p>精简500题</p>
                  </div>
                </van-col>
                <van-col :span="6">
                  <div @click="href()" class="index-menu-box">
                    <img src="../assets/index7.png" />
                    <p>考前2小时</p>
                  </div>
                </van-col>
                <van-col :span="6">
                  <div @click="href()" class="index-menu-box">
                    <img src="../assets/index8.png" />
                    <p>直播课</p>
                  </div>
                </van-col>
              </van-row>
            </div>
            <div class="index-panel">
              <div class="panel-hd">学车须知</div>
              <div class="panel-steps">
                <ul class="step-cells">
                  <li @click="href('/ApplyNotice')">
                    <img src="../assets/images/image1.png" alt />
                    <p>报名须知</p>
                  </li>
                  <div class="arrow"></div>
                  <li @click="href('/DrivingFlow')">
                    <img src="../assets/images/image2.png" alt />
                    <p>学车流程</p>
                  </li>
                  <div class="arrow"></div>
                  <li @click="href('/PayFlow')">
                    <img src="../assets/images/image3.png" alt />
                    <p>支付流程</p>
                  </li>
                  <div class="arrow"></div>
                  <li @click="href('/Syllabus')">
                    <img src="../assets/images/image4.png" alt />
                    <p>教学大纲</p>
                  </li>
                  <div class="arrow"></div>
                  <li @click="href()">
                    <img src="../assets/images/image5.png" alt />
                    <p>考试须知</p>
                  </li>
                </ul>
              </div>
            </div>
            <div class="index-panel">
              <div class="panel-hd">
                <p>学车课堂</p>
                <img
                  @click="href('/EvenMore', '1')"
                  src="../assets/images/05.png"
                  alt
                />
              </div>
              <div class="panel-bd">
                <div class="vv-scroll">
                  <ul class="video-list">
                    <li
                      v-for="(item, index) in cardSchool"
                      :key="index"
                      @click="href('/CardSchool', item.id, '1')"
                    >
                      <div class="vv-box">
                        <div class="vv-title">{{ item.title }}</div>
                        <div class="vv-play">
                          <i class="iconfont van-icon-bofang"></i>
                          {{ item.djl }}W
                        </div>
                      </div>
                    </li>
                  </ul>
                </div>
              </div>
            </div>
            <div class="index-panel">
              <div class="panel-hd">
                <p>科一社区</p>
                <div @click="href('/CommunityList', '1')">更多</div>
              </div>
              <div class="panel-bd">
                <van-row :gutter="12" class="bbs-rows">
                  <van-col :span="12">
                    <router-link
                      to="/PostsPage/448a0b44-eeaa-472b-a24c-2458485c0035"
                      class="bbs-link bbs-sm-link"
                    >
                      <img src="../assets/shequ1.png" alt />
                    </router-link>
                    <router-link
                      to="/PostsPage/0d2830ca-5e42-422d-a368-5d355ea49276"
                      class="bbs-link bbs-md-link"
                    >
                      <img src="../assets/shequ2.png" alt />
                    </router-link>
                  </van-col>
                  <van-col :span="12">
                    <router-link
                      to="/PostsPage/fcfe5374-5f8a-47b4-9622-dc3c2ad329d0"
                      class="bbs-link bbs-md-link"
                    >
                      <img src="../assets/shequ3.png" alt />
                    </router-link>
                    <router-link
                      to="/PostsPage/7906ce49-c6b0-4c30-95dd-da3746cf3bf3"
                      class="bbs-link bbs-sm-link"
                    >
                      <img src="../assets/shequ4.png" alt />
                    </router-link>
                  </van-col>
                </van-row>
              </div>
            </div>
          </div>
        </van-tab>
        <!-- 科二 -->
        <van-tab>
          <template #title>
            <span class="tab-span">科二</span>
          </template>
          <div class="cf_overflow">
            <div class="ke-banner">
              <van-swipe :autoplay="3000" height="140" class="ke-swiper">
                <van-swipe-item v-for="(image, index) in images" :key="index">
                  <img :src="image.picaddress" alt />
                </van-swipe-item>
              </van-swipe>
            </div>

            <div class="index-panel">
              <van-row :gutter="10" class="index-menus">
                <van-col :span="6">
                  <div @click="href()" class="index-menu-box">
                    <img src="../assets/km1.png" alt />
                    <p>VIP课程</p>
                  </div>
                </van-col>
                <van-col :span="6">
                  <router-link to="/TwoEsoterica/2" class="index-menu-box">
                    <img src="../assets/km2.png" alt />
                    <p>科目二秘籍</p>
                  </router-link>
                </van-col>
                <van-col :span="6">
                  <router-link to="/TestProcess" class="index-menu-box">
                    <img src="../assets/km3.png" alt />
                    <p>考试流程</p>
                  </router-link>
                </van-col>
                <van-col :span="6">
                  <router-link to="/TestStandard" class="index-menu-box">
                    <img src="../assets/km4.png" alt />
                    <p>考试标准</p>
                  </router-link>
                </van-col>
              </van-row>
            </div>
            <div class="index-panel">
              <div class="panel-hd">
                <p>考点视频</p>
                <div @click="href('/TestVideo', '2')">更多视频</div>
              </div>
              <div class="index-panel-body">
                <van-row :gutter="16" class="video-rows">
                  <van-col
                    :span="12"
                    v-for="(item, i) in lists"
                    :key="i"
                    @click="href('/TeachingVideo', '2', item.id)"
                  >
                    <div class="video-box">
                      <div class="video-photo">
                        <img :src="item.picaddress" />
                        <div class="v-num">{{ item.djl }}人观看</div>
                      </div>
                      <div class="vv-title">{{ item.title }}</div>
                    </div>
                  </van-col>
                </van-row>
              </div>
            </div>
            <div class="index-panel">
              <div class="panel-hd">
                <p>基础操作</p>
                <div @click="href('/BasicOperation', '2')">更多视频</div>
              </div>
              <div class="panel-bd kd-video">
                <van-cell
                  v-for="(item, i) in kaodian"
                  :key="i"
                  @click="href('/TeachingVideo', '2', item.id)"
                >
                  <template #icon>
                    <div class="kd-photo">
                      <img :src="item.picaddress" alt />
                      <div class="iconfont van-icon-bofang"></div>
                      <!-- <div class="kd-tm">02:33</div> -->
                    </div>
                  </template>
                  <template #title>
                    <div class="kd-title">{{ item.title }}</div>
                    <div class="kd-attr">
                      <!-- <div class="item"><van-icon name="like-o" />444</div> -->
                      <div class="item">
                        <van-icon name="video-o" />{{ item.djl }}
                      </div>
                    </div>
                  </template>
                </van-cell>
              </div>
            </div>
            <div class="index-panel">
              <div class="panel-hd">
                <p>科二社区</p>
                <div @click="href('/CommunityList', '2')">更多</div>
              </div>
              <div class="panel-bd">
                <van-cell
                  class="nBss-cell"
                  v-for="(item, i) in bbslist2"
                  :key="i"
                  @click="href('/PostsPage', item.articleId)"
                >
                  <template #icon>
                    <div class="nb-avatar">
                      <img :src="item.img" alt />
                    </div>
                  </template>
                  <template>
                    <div class="info">
                      <div class="author">{{ item.name }}</div>
                      <div class="postTime">{{ item.articleTime }}</div>
                    </div>
                    <div class="content">
                      <div class="text">
                        <span>{{ item.articleTitle }}</span>
                      </div>
                      <div class="images" v-if="item.imglist">
                        <van-row :gutter="10">
                          <van-col
                            :span="8"
                            v-for="(subitem, i) in item.imglist"
                            :key="i"
                          >
                            <img :src="subitem" />
                          </van-col>
                        </van-row>
                      </div>
                      <div class="bottom-icon">
                        <div class="icon">
                          <van-icon name="eye-o" />{{ item.articleVisitCount }}
                        </div>
                        <div class="icon">
                          <!-- <van-icon name="like-o" />{{ item.articleVisitCount }} -->
                        </div>
                        <div class="icon">
                          <van-icon name="chat-o" />{{
                            item.articleCommentCount
                          }}
                        </div>
                      </div>
                    </div>
                  </template>
                </van-cell>
              </div>
            </div>
          </div>
        </van-tab>
        <!-- 科三 -->
        <van-tab>
          <template #title>
            <span class="tab-span">科三</span>
          </template>
          <div class="cf_overflow">
            <div class="ke-banner">
              <van-swipe :autoplay="3000" height="140" class="ke-swiper">
                <van-swipe-item v-for="(image, index) in images" :key="index">
                  <img :src="image.picaddress" alt />
                </van-swipe-item>
              </van-swipe>
            </div>

            <div class="index-panel">
              <van-row :gutter="10" class="index-menus">
                <van-col :span="6">
                  <div @click="href()" class="index-menu-box">
                    <img src="../assets/km1.png" alt />
                    <p>VIP课程</p>
                  </div>
                </van-col>
                <van-col :span="6">
                  <router-link to="/TwoEsoterica/3" class="index-menu-box">
                    <img src="../assets/km2.png" alt />
                    <p>科目三秘籍</p>
                  </router-link>
                </van-col>
                <van-col :span="6">
                  <router-link to="/TestProcess" class="index-menu-box">
                    <img src="../assets/km3.png" alt />
                    <p>考试流程</p>
                  </router-link>
                </van-col>
                <van-col :span="6">
                  <router-link to="/TestStandard" class="index-menu-box">
                    <img src="../assets/km4.png" alt />
                    <p>考试标准</p>
                  </router-link>
                </van-col>
              </van-row>
            </div>
            <div class="index-panel">
              <div class="panel-hd">
                <p>考点视频</p>
                <div @click="href('/TestVideo', '3')">更多视频</div>
              </div>
              <div class="index-panel-body">
                <van-row :gutter="16" class="video-rows">
                  <van-col
                    :span="12"
                    v-for="(item, i) in listss"
                    :key="i"
                    @click="href('/TeachingVideo', '3', item.id)"
                  >
                    <div class="video-box">
                      <div class="video-photo">
                        <img :src="item.picaddress" />
                        <div class="v-num">{{ item.djl }}人观看</div>
                      </div>
                      <div class="vv-title">{{ item.title }}</div>
                    </div>
                  </van-col>
                </van-row>
              </div>
            </div>
            <div class="index-panel">
              <div class="panel-hd">
                <p>基础操作</p>
                <div @click="href('/BasicOperation', '3')">更多视频</div>
              </div>
              <div class="panel-bd kd-video">
                <van-cell
                  v-for="(item, i) in kaodian1"
                  :key="i"
                  @click="href('/TeachingVideo', '2', item.id)"
                >
                  <template #icon>
                    <div class="kd-photo">
                      <img :src="item.picaddress" alt />
                      <div class="iconfont van-icon-bofang"></div>
                      <!-- <div class="kd-tm">02:33</div> -->
                    </div>
                  </template>
                  <template #title>
                    <div class="kd-title">{{ item.title }}</div>
                    <div class="kd-attr">
                      <!-- <div class="item"><van-icon name="like-o" />444</div> -->
                      <div class="item">
                        <van-icon name="video-o" />{{ item.djl }}
                      </div>
                    </div>
                  </template>
                </van-cell>
              </div>
            </div>
            <div class="index-panel">
              <div class="panel-hd">
                <p>科三社区</p>
                <div @click="href('/CommunityList', '3')">更多</div>
              </div>
              <div class="panel-bd">
                <van-cell
                  class="nBss-cell"
                  v-for="(item, i) in bbslist3"
                  :key="i"
                  @click="href('/PostsPage', item.articleId)"
                >
                  <template #icon>
                    <div class="nb-avatar">
                      <img :src="item.img" alt />
                    </div>
                  </template>
                  <template>
                    <div class="info">
                      <div class="author">{{ item.name }}</div>
                      <div class="postTime">{{ item.articleTime }}</div>
                    </div>
                    <div class="content">
                      <div class="text">
                        <span>{{ item.articleTitle }}</span>
                      </div>
                      <div class="images" v-if="item.imglist">
                        <van-row :gutter="10">
                          <van-col
                            :span="8"
                            v-for="(subitem, i) in item.imglist"
                            :key="i"
                          >
                            <img :src="subitem" />
                          </van-col>
                        </van-row>
                      </div>
                      <div class="bottom-icon">
                        <div class="icon">
                          <van-icon name="eye-o" />{{ item.articleVisitCount }}
                        </div>
                        <div class="icon">
                          <!-- <van-icon name="like-o" />{{ item.articleVisitCount }} -->
                        </div>
                        <div class="icon">
                          <van-icon name="chat-o" />{{
                            item.articleCommentCount
                          }}
                        </div>
                      </div>
                    </div>
                  </template>
                </van-cell>
              </div>
            </div>
          </div>
        </van-tab>
        <!-- end -->
        <!-- 科四 -->
        <van-tab>
          <template #title>
            <span class="tab-span">科四</span>
          </template>
          <div class="cf_overflow">
            <div class="index-grid">
              <div class="index-banner">
                <van-swipe :autoplay="3000" height="140" class="banner-swiper">
                  <van-swipe-item v-for="(image, index) in images" :key="index">
                    <img :src="image.picaddress" />
                  </van-swipe-item>
                </van-swipe>
              </div>
              <van-row :gutter="20" class="enter-rows">
                <van-col :span="12">
                  <router-link to="/SequentialExam/4" class="enter-link lk-1">
                    <img src="../assets/link1.png" />
                    <div class="weui-cell__bd">
                      <div class="txt">顺序练习</div>
                      <!-- <div class="val">0/1325题</div> -->
                    </div>
                  </router-link>
                </van-col>
                <van-col :span="12">
                  <router-link to="/MockExam/4" class="enter-link lk-2">
                    <img src="../assets/link1.png" />
                    <div class="weui-cell__bd">
                      <div class="txt">模拟考试</div>
                      <!-- <div class="val">未考试/0分</div> -->
                    </div>
                  </router-link>
                </van-col>
              </van-row>
              <van-row :gutter="10" class="index-menus">
                <van-col :span="6">
                  <div @click="href()" class="index-menu-box">
                    <img src="../assets/index1.png" />
                    <p>VIP课程</p>
                  </div>
                </van-col>
                <van-col :span="6">
                  <router-link to="/IconTechnical" class="index-menu-box">
                    <img src="../assets/index2.png" />
                    <p>图标技巧</p>
                  </router-link>
                </van-col>
                <van-col :span="6">
                  <div @click="href()" class="index-menu-box">
                    <img src="../assets/index3.png" />
                    <p>专项练习</p>
                  </div>
                </van-col>
                <van-col :span="6">
                  <router-link to="/MistakesCollect" class="index-menu-box">
                    <img src="../assets/index4.png" />
                    <p>错题收藏</p>
                  </router-link>
                </van-col>
                <van-col :span="6">
                  <router-link to="/Esoterica/4" class="index-menu-box">
                    <img src="../assets/index5.png" />
                    <p>考试秘笈</p>
                  </router-link>
                </van-col>
                <van-col :span="6">
                  <div @click="href()" class="index-menu-box">
                    <img src="../assets/index6.png" />
                    <p>精简500题</p>
                  </div>
                </van-col>
                <van-col :span="6">
                  <div @click="href()" class="index-menu-box">
                    <img src="../assets/index7.png" />
                    <p>考前2小时</p>
                  </div>
                </van-col>
                <van-col :span="6">
                  <div @click="href()" class="index-menu-box">
                    <img src="../assets/index8.png" />
                    <p>直播课</p>
                  </div>
                </van-col>
              </van-row>
            </div>
            <div class="index-panel">
              <div class="panel-hd">学车须知</div>
              <div class="panel-steps">
                <ul class="step-cells">
                  <li @click="href('/ApplyNotice')">
                    <img src="../assets/images/image1.png" alt />
                    <p>报名须知</p>
                  </li>
                  <div class="arrow"></div>
                  <li @click="href('/DrivingFlow')">
                    <img src="../assets/images/image2.png" alt />
                    <p>学车流程</p>
                  </li>
                  <div class="arrow"></div>
                  <li @click="href('/PayFlow')">
                    <img src="../assets/images/image3.png" alt />
                    <p>支付流程</p>
                  </li>
                  <div class="arrow"></div>
                  <li @click="href('/Syllabus')">
                    <img src="../assets/images/image4.png" alt />
                    <p>教学大纲</p>
                  </li>
                  <div @click="href()" class="arrow"></div>
                  <a>
                    <img src="../assets/images/image5.png" alt />
                    <p>考试须知</p>
                  </a>
                </ul>
              </div>
            </div>
            <!-- <div class="index-panel">
              <div class="panel-hd">
                <p>学车课堂</p>
                <img
                  @click="href('/EvenMore', '4')"
                  src="../assets/images/05.png"
                  alt
                />
              </div>
              <div class="panel-bd">
                <div class="vv-scroll">
                  <ul class="video-list">
                    <li
                      v-for="(item, index) in cardSchool"
                      :key="index"
                      @click="href('/CardSchool', item.id, '4')"
                    >
                      <div class="vv-box">
                        <div class="vv-title">{{ item.title }}</div>
                        <div class="vv-play">
                          <i class="iconfont van-icon-bofang"></i>
                          {{ item.djl }}W
                        </div>
                      </div>
                    </li>
                  </ul>
                </div>
              </div>
            </div> -->
            <div class="index-panel">
              <div class="panel-hd">
                <p>科四社区</p>
                <div @click="href('/CommunityList', '4')">更多</div>
              </div>
              <div class="panel-bd">
                <van-row :gutter="12" class="bbs-rows">
                  <van-col :span="12">
                    <router-link
                      to="/PostsPage/448a0b44-eeaa-472b-a24c-2458485c0035"
                      class="bbs-link bbs-sm-link"
                    >
                      <img src="../assets/shequ1.png" alt />
                    </router-link>
                    <router-link
                      to="/PostsPage/0d2830ca-5e42-422d-a368-5d355ea49276"
                      class="bbs-link bbs-md-link"
                    >
                      <img src="../assets/shequ2.png" alt />
                    </router-link>
                  </van-col>
                  <van-col :span="12">
                    <router-link
                      to="/PostsPage/fcfe5374-5f8a-47b4-9622-dc3c2ad329d0"
                      class="bbs-link bbs-md-link"
                    >
                      <img src="../assets/shequ3.png" alt />
                    </router-link>
                    <router-link
                      to="/PostsPage/7906ce49-c6b0-4c30-95dd-da3746cf3bf3"
                      class="bbs-link bbs-sm-link"
                    >
                      <img src="../assets/shequ4.png" alt />
                    </router-link>
                  </van-col>
                </van-row>
              </div>
            </div>
          </div>
        </van-tab>
        <!-- end -->
        <!-- 拿本 -->
        <van-tab>
          <template #title>
            <span class="tab-span">拿本</span>
          </template>
          <div class="cf_overflow">
            <div class="ke-banner">
              <van-swipe :autoplay="3000" height="140" class="ke-swiper">
                <van-swipe-item v-for="(image, index) in images" :key="index">
                  <img :src="image.picaddress" alt />
                </van-swipe-item>
              </van-swipe>
            </div>
            <div class="index-panel">
              <van-row :gutter="10" class="index-menus">
                <van-col :span="6">
                  <div @click="href()" class="index-menu-box">
                    <img src="../assets/na1.png" alt />
                    <p>买车福利</p>
                  </div>
                </van-col>
                <van-col :span="6">
                  <div @click="href()" class="index-menu-box">
                    <img src="../assets/na2.png" alt />
                    <p>扣满12分</p>
                  </div>
                </van-col>
                <van-col :span="6">
                  <div @click="href()" class="index-menu-box">
                    <img src="../assets/na3.png" alt />
                    <p>帮我选车</p>
                  </div>
                </van-col>
                <van-col :span="6">
                  <div @click="href()" class="index-menu-box">
                    <img src="../assets/na4.png" alt />
                    <p>精品二手车</p>
                  </div>
                </van-col>
              </van-row>
            </div>
            <!-- <div class="index-panel">
              <div class="panel-hd">汽车视频</div>
              <div class="car-video">
                <van-swipe
                  :autoplay="3000"
                  height="180"
                  class="car-swiper"
                  :show-indicators="false"
                >
                  <van-swipe-item
                    v-for="(image, index) in images4"
                    :key="index"
                  >
                    <div class="car-video-photo">
                      <img v-lazy="image.pic" />
                      <div class="ck-title">{{ image.title }}</div>
                      <div class="iconfont van-icon-bofang"></div>
                    </div>
                  </van-swipe-item>
                </van-swipe>
              </div>
            </div> -->
            <div class="index-panel">
              <div class="panel-hd">考点视频</div>
              <div class="panel-bd kd-video">
                <van-cell
                  v-for="(item, i) in kaodian5"
                  :key="i"
                  @click="href('/TeachingVideo', '5', item.id)"
                >
                  <template #icon>
                    <div class="kd-photo">
                      <img :src="item.picaddress" alt />
                      <div class="iconfont van-icon-bofang"></div>
                    </div>
                  </template>
                  <template #title>
                    <div class="kd-title">{{ item.title }}</div>
                    <div class="kd-attr">
                      <!-- <div class="item"><van-icon name="like-o" />444</div> -->
                      <div class="item">
                        <van-icon name="video-o" />{{ item.djl }}
                      </div>
                    </div>
                  </template>
                </van-cell>
              </div>
            </div>
            <div class="index-panel">
              <div class="panel-hd">
                <p>拿本社区</p>
                <div @click="href('/CommunityList', '5')">更多</div>
              </div>
              <div class="panel-bd">
                <van-cell
                  class="nBss-cell"
                  v-for="(item, i) in bbslist5"
                  :key="i"
                  @click="href('/PostsPage', item.articleId)"
                >
                  <template #icon>
                    <div class="nb-avatar">
                      <img :src="item.img" alt />
                    </div>
                  </template>
                  <template>
                    <div class="info">
                      <div class="author">{{ item.name }}</div>
                      <div class="postTime">{{ item.articleTime }}</div>
                    </div>
                    <div class="content">
                      <div class="text">
                        <span>{{ item.articleTitle }}</span>
                      </div>
                      <div class="images" v-if="item.imglist">
                        <van-row :gutter="10">
                          <van-col
                            :span="8"
                            v-for="(subitem, i) in item.imglist"
                            :key="i"
                          >
                            <img :src="subitem" />
                          </van-col>
                        </van-row>
                      </div>
                      <div class="bottom-icon">
                        <div class="icon">
                          <van-icon name="eye-o" />{{ item.articleVisitCount }}
                        </div>
                        <div class="icon">
                          <!-- <van-icon name="like-o" />{{ item.articleVisitCount }} -->
                        </div>
                        <div class="icon">
                          <van-icon name="chat-o" />{{
                            item.articleCommentCount
                          }}
                        </div>
                      </div>
                    </div>
                  </template>
                </van-cell>
              </div>
            </div>
          </div>
        </van-tab>
      </van-tabs>
    </div>
    <!-- footer -->
    <van-tabbar :z-index="999" v-model="active" :placeholder="true">
      <van-tabbar-item icon="tongxunlu" to="/SignIndex">报名</van-tabbar-item>
      <van-tabbar-item icon="zixun" to="/News">资讯</van-tabbar-item>
      <van-tabbar-item icon="faxian" to="/">考试</van-tabbar-item>
      <van-tabbar-item icon="home" @click="link">商城</van-tabbar-item>
      <van-tabbar-item icon="wode" to="/Ucenter">我的</van-tabbar-item>
    </van-tabbar>
  </div>
</template>
<script>
import Search from "./sign/search";
// 引入
import { baseURL } from "../assets/js/config";
// 引入接口文件
import {
  HomeSlideShow,
  CardSchool,
  ExamVideo,
  SubscribeCommunity
} from "../assets/js/api/exam";
import { Toast } from "vant";
// import { Toast } from "vant";
export default {
  data() {
    return {
      tabactive: 0,
      active: 2,
      slid: 1,
      images: [],
      lists: [],
      listss: [],
      subjects: [
        {
          title: "灯光",
          pic: require("../assets/k2_1.png")
        },
        {
          title: "百米加减档",
          pic: require("../assets/k2_2.png")
        },
        {
          title: "变更车道",
          pic: require("../assets/k2_3.png")
        },
        {
          title: "通过路口，学校等区域",
          pic: require("../assets/k2_1.png")
        },
        {
          title: "超车，掉头",
          pic: require("../assets/k2_1.png")
        }
      ],
      kaodian: [],
      kaodian1: [],
      kaodian5: [],
      bbslist: [
        {
          title: "一点通0022",
          pic: require("../assets/naben1.png"),
          avatar: require("../assets/avatar2.png")
        },
        {
          title: "一点通0033",
          pic: require("../assets/naben2.png"),
          avatar: require("../assets/avatar2.png")
        },
        {
          title: "一点通0044",
          avatar: require("../assets/step6.png")
        },
        {
          title: "一点通055",
          avatar: require("../assets/jiaol.jpg")
        }
      ],
      bbslist2: [],
      cardSchool: [],
      bbslist3: [],
      bbslist5: []
    };
  },

  mounted() {
    this.baseURL = baseURL;
    if (sessionStorage.getItem("tabactive")) {
      this.tabactive = Number(sessionStorage.getItem("tabactive"));
      // console.log(typeof this.tabactive);
    }

    // 科二社区
    SubscribeCommunity("2").then(res => {
      // console.log(res);
      for (let i = 0; i < res.data.articleLists.length; i++) {
        if (i < 4) {
          this.bbslist2.push(res.data.articleLists[i]);
        }
      }

      // console.log(this.bbslist2);
    });

    // 科三的社区
    SubscribeCommunity("3").then(res => {
      // console.log(res);
      for (let i = 0; i < res.data.articleLists.length; i++) {
        if (i < 4) {
          this.bbslist3.push(res.data.articleLists[i]);
        }
      }

      // console.log(this.bbslist2);
    });

    // 拿本社区
    SubscribeCommunity("5").then(res => {
      // console.log(res);
      for (let i = 0; i < res.data.articleLists.length; i++) {
        if (i < 4) {
          this.bbslist5.push(res.data.articleLists[i]);
        }
      }
    });

    this.HomeSlideShow();
    this.CardSchool();
    // 科目二考点视频
    ExamVideo("2", "1").then(res => {
      if (res.code == 0) {
        for (let i = 0; i < res.data.length; i++) {
          if (i < 4) {
            this.lists.push(res.data[i]);
          }
        }
      }
      // console.log(this.lists);
    });
    ExamVideo("3", "1").then(res => {
      if (res.code == 0) {
        for (let i = 0; i < res.data.length; i++) {
          if (i < 3) {
            this.listss.push(res.data[i]);
          }
        }
      }
      // console.log(this.listss);
    });
    ExamVideo("2", "2").then(res => {
      // console.log(res);
      if (res.code == 0) {
        for (let i = 0; i < res.data.length; i++) {
          if (i < 4) {
            this.kaodian.push(res.data[i]);
          }
        }
      }
      // console.log(this.lists);
    });
    ExamVideo("3", "2").then(res => {
      // console.log(res);
      if (res.code == 0) {
        for (let i = 0; i < res.data.length; i++) {
          if (i < 3) {
            this.kaodian1.push(res.data[i]);
          }
        }
      }
      // console.log(this.listss);
    });
    ExamVideo("5", "1").then(res => {
      // console.log(res);
      if (res.code == 0) {
        for (let i = 0; i < res.data.length; i++) {
          if (i < 3) {
            this.kaodian5.push(res.data[i]);
          }
        }
      }
      // console.log(this.listss);
    });
  },
  components: {
    Search
  },

  beforeRouteLeave(to, from, next) {
    sessionStorage.setItem("tabactive", this.tabactive);
    next();
  },

  methods: {
    link() {
      window.open(
        "https://www.guazi.com/sjz/?ca_n=pcbiaoti&ca_s=pz_baidu&tk_p_mti=ad.pz_baidu.pcbiaoti.1.112642602791964672",
        "_blank"
      );
    },
    // 首页轮播图

    HomeSlideShow() {
      HomeSlideShow().then(res => {
        // console.log(res);
        this.images = res.data;
      });
    },

    // 学车学堂
    CardSchool() {
      CardSchool().then(res => {
        // console.log(res);
        this.cardSchool = res.data;
        // console.log(this.cardSchool);
      });
    },
    href(url, type, id) {
      if (!url) {
        Toast.fail("正在开发中");
        return;
      }
      if (url == "/TestVideo") {
        this.$router.push({
          path: `${url}/${type}`
        });
        return;
      }
      if (url == "/TeachingVideo" || url == "/CardSchool") {
        this.$router.push({
          path: `${url}/${type}/${id}`
        });
        return;
      }

      if (type == undefined) {
        this.$router.push({
          path: url
        });
      } else {
        this.$router.push({
          path: `${url}/${type}`
        });
      }
    }
  }
};
</script>
<style scoped>
.tab-span {
  width: 60px !important;
}
</style>
